package chapter02

import scala.util.Random

object Test30_FunctionCollection {
  def main(args: Array[String]): Unit = {
    val list = List(1, 2, 3, 4, 5)
    //长度
    println(list.length)
    println(list.size)
    //遍历
    list.foreach(println(_))
    //迭代器
    for(i<-list.iterator){println(i)}
    //生成字符串
    println(list.mkString(","))
    //是否包含
    println(list.contains(5))
    //洗牌函数
    val list1 = Random.shuffle(list)
    println(list1)
  }
}
